home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
message
/
messag
/
formmove.fr_
/
formmove.fr
Wrap
Text File
|
1995-01-14
|
3KB
|
90 lines
VERSION 2.00
Begin Form FormMove
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
ClientHeight = 2760
ClientLeft = 1080
ClientTop = 1485
ClientWidth = 5010
ControlBox = 0 'False
Height = 3165
Left = 1020
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2760
ScaleWidth = 5010
Top = 1140
Width = 5130
Begin Message Message1
Left = 4740
Top = 2400
End
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Label2"
ForeColor = &H00000080&
Height = 735
Left = 300
TabIndex = 1
Top = 1800
Width = 4395
End
Begin Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Label1"
ForeColor = &H00800000&
Height = 1455
Left = 300
TabIndex = 0
Top = 180
Width = 4395
End
End
Sub Form_Load ()
FormCenterScreen Me
Msg$ = nl + "This is not an MDI form, but it could be." + nl
Msg$ = Msg$ + "And, it does NOT have a caption." + nl
Msg$ = Msg$ + "But, you can move it by holding down" + nl
Msg$ = Msg$ + "the left mouse button and dragging" + nl
Msg$ = Msg$ + "the form around on the screen."
Label1.Caption = Msg$
Msg$ = nl + "Dbl-Click the right mouse button" + nl
Msg$ = Msg$ + "on the form to close it..."
Label2.Caption = Msg$
Message1.hWindow = Me.hWnd
Message1.Status(WM_NCHITTEST) = True
Message1.Status(WM_NCrButtonDblClk) = True
Screen.MousePointer = 0
End Sub
Sub Form_Paint ()
DoForm3D Me, "raised", 2, 0
DoForm3D Me, "sunken", 2, 2
DoControl3D Label1, "sunken", 1
DoControl3D Label2, "sunken", 1
End Sub
Sub Message1_Receive (Msg As Integer, wParam As Integer, lParam As Long, UseRetVal As Integer, RetVal As Long)
If Msg = WM_NCHITTEST Then
RetVal = HTCAPTION
UseRetVal = 1
Exit Sub
End If
If Msg = WM_NCrButtonDblClk Then
'don't use SendMessage in a Receive event!!!
ret% = PostMessage(Me.hWnd, WM_CLOSE, 0, 0&)
End If
End Sub